<template>
  <div>
    <ul class="myself mui-table-view" >
       <li class="mui-table-view-cell mui-media" v-for="(item, index) in newList" :key="index">
        <router-link :to="'/home/newInfo/'+item.id">
          <img class="mui-media-object mui-pull-left" :src="item.img_url" />
          <div class="mui-media-body">
          <span>
          {{item.title}}
          </span>
            <p class="mui-ellipsis">
              <span>发表时间:{{item.add_time}}</span>
              <span>点击{{item.click}}次</span>
            </p>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: new Date(),
      message: "点击0次",
      newList: []
    };
  },
  created() {
    this.getNewList();
  },
  methods: {
    getNewList() {
      this.$http
        .get("api/getnewslist")
        .then(data => {
          console.log(data);
          if (data.body.status === 0) {
            this.newList = data.body.message;
          }
        });
    }
  }
};
</script>

<style lang="scss" scoped>

.mui-media-body>span{
 font-size:14px;
}
.myself {
  img {
    width: 30px;
    height: 30px;
  }
}

  
  .mui-ellipsis{display: flex;
  justify-content: space-between;}

</style>
